package com.unittec.zk.provider.flowable;

import com.unittec.zk.provider.ApplicationContextProvider;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import springfox.documentation.swagger2.annotations.EnableSwagger2;


/**
 * @author Jason
 * @description 鉴权启动类
 * @date 2019/11/07
 */
@SpringBootApplication(scanBasePackages = {"com.unittec.zk.provider"})
@MapperScan(basePackages = "com.baomidou.mybatisplus.core.mapper")
@EnableCaching
@EnableAsync
@EnableHystrix
@EnableSwagger2
public class FlowAbleApplication {

    public static void main(String[] args) {
        try {
            SpringApplication.run(FlowAbleApplication.class, args);
            curEnvironmentOut();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void curEnvironmentOut() {
        System.out.println("****************************************************************************");
        Environment env = ApplicationContextProvider.getBean(Environment.class);
        String profile = env.getProperty("spring.profiles.active");
        System.out.println("当前启动环境:" + profile);
        System.out.println("****************************************************************************");
    }

}
